package com.zy.ivideo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

@Entity
@EntityListeners(AuditingEntityListener.class)
@Data
@ApiModel(value = "银行卡实体类",description = "银行卡实体类")
@Table(name = "b_bankcard")
public class BankCardEntity {
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键id",position = 16,example = "0")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty(value = "账号id",position = 16,example = "0")
    @Column(name = "accountid",nullable = false,length = 11,columnDefinition = "COMMENT '账号id'")
    private Long accountid;

    @ApiModelProperty(value = "银行卡号",position = 16,example = "8888000088880000888")
    @Column(name = "cardnum",length = 50,columnDefinition = "COMMENT '银行卡号'")
    private String cardnum;

    @ApiModelProperty(value = "银行类型 (建设银行 工商银行 招商银行 农业银行等)",position = 16,example = "建设银行")
    @Column(name = "banktype",length = 50,columnDefinition = "COMMENT '银行类型 (建设银行 工商银行 招商银行 农业银行等)'")
    private String banktype;

    @ApiModelProperty(value = "创建时间",position = 16,example = "2024-01-01 00:00:00")
    @CreatedDate
    @Column(name = "createtime",columnDefinition = "COMMENT '创建时间'")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createtime;
}
